home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 3 / Amiga Tools 3.iso / rexx / bulgeanim.rexx < prev    next >
OS/2 REXX Batch file  |  1995-06-22  |  2KB  |  70 lines

  1. /*************************/
  2. /* Image Engineer script */
  3. /* by Simon Edwards      */
  4. /*************************/
  5.  
  6. Options results
  7. signal on error            /* Setup a place for errors to go */
  8.  
  9.  
  10. 'REQUEST "This script generates animation frames" "Ok"'
  11.  
  12. 'GET_NUMBER "Amount to bulge by" 1 100 "Ok|Cancel" 20'
  13. BulgeAmount=RESULT
  14.  
  15. 'GET_NUMBER "Enter the number of frames to generate" 1 100 "Ok|Cancel" 10'
  16. NumberOfFrames=RESULT
  17.  
  18. 'GET_FILE "Enter base path and file name"'
  19. BasePath=RESULT
  20.  
  21. 'GET_RENDER COLOUR "Set render options"'
  22. RenderOptions=RESULT
  23.  
  24. 'GET_FILE_TYPE "Select Save format"'
  25. SaveFormat=RESULT
  26.  
  27. PROJECT_INFO arg(1) WIDTH
  28. ProWidth=RESULT
  29. PROJECT_INFO arg(1) HEIGHT
  30. ProHeight=RESULT
  31.  
  32. XOffset=ProWidth/2
  33. YOffset=ProHeight/2
  34.  
  35. if ProWidth<ProHeight then
  36.     Radius=ProWidth/2
  37. else
  38.     Radius=ProHeight/2
  39.  
  40. do i=1 to NumberOfFrames
  41.  
  42. 'BULGE' arg(1) XOffset YOffset Radius BulgeAmount*(i-1)/(NumberOfFrames-1) 'BEST'
  43. Frame=RESULT
  44. 'SET_RENDER' Frame RenderOptions
  45. 'RENDER' Frame
  46. 'SAVE' Frame '"'||BasePath||right(i,3,'0')||'" "'||SaveFormat||'"'
  47. 'CLOSE' Frame
  48. end
  49.  
  50. 'REQUEST "Done, generated ' NumberOfFrames 'frames."'
  51. exit
  52.  
  53. /*******************************************************************/
  54. /* This is where control goes when an error code is returned by IE */
  55. /* It puts up a message saying what happened and on which line     */
  56. /*******************************************************************/
  57. error:
  58. if RC=5 then do            /* Did the user just cancel us? */
  59.     IE_TO_FRONT
  60.     LAST_ERROR
  61.     'REQUEST "'||RESULT||'"'
  62.     exit
  63. end
  64. else do
  65.     IE_TO_FRONT
  66.     LAST_ERROR
  67.     'REQUEST "Error detected!!!'||D2C(10)||'Image Engineer error message is as follows'||D2C(10)||result||D2C(10)||'Script failed on line '||SIGL||'"' 'Doh!'
  68.     exit
  69. end
  70.